package com.lkd.http.controller;

import com.lkd.common.RedisConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tx")
public class TxController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @GetMapping("/data")
    public String data(Integer type){
        String s = stringRedisTemplate.opsForSet()
                .randomMember(RedisConstants.INFO_CONTENT_PREFIX + type);
        return s;
    }

}
